home *** CD-ROM | disk | FTP | other *** search
- this.dx = random(10) - 5;
- this.dy = random(10) - 5;
- r = 15;
- h = 450;
- _root.maxim = 6;
- stop();
- this.onEnterFrame = function()
- {
- if(this._x + r < h && this._x - r > 0)
- {
- this._x += this.dx;
- }
- else
- {
- this.dx *= -1;
- this._x += dx;
- if(_X - r < 0)
- {
- _X = 2 + r;
- }
- if(_X + r > h)
- {
- _X = h - 2 - r;
- }
- }
- if(this._y + r < h && this._y - r > 0)
- {
- this._y += this.dy;
- }
- else
- {
- this.dy *= -1;
- this._y += dy;
- if(_Y - r < 0)
- {
- _Y = 2 + r;
- }
- if(_Y + r > h)
- {
- _Y = h - 2 - r;
- }
- }
- v = Math.sqrt(dx * dx + dy * dy);
- if(v < _root.maxim)
- {
- dx *= 1.01;
- dy *= 1.01;
- }
- else if(v > _root.maxim)
- {
- dx *= 0.98;
- dy *= 0.98;
- }
- _root.maxim *= 1.00006;
- trace(_root.maxim);
- };
-